package com.fengye.security.security.service.admin;

import com.fengye.security.annotation.RoleAdminOrRead;
import com.fengye.security.domain.Permission;
import com.fengye.security.security.repository.PermissionRepository;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@RequiredArgsConstructor
@Service
public class PermissionAdminService {

    private final PermissionRepository permissionRepo;

    @RoleAdminOrRead
    public List<Permission> findAll() {
        return permissionRepo.findAll();
    }
}
